package com.hardroid.workload.ui.fragment;

import java.util.Date;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.DigitalClock;
import android.widget.TextView;

import com.hardroid.workload.R;
import com.hardroid.workload.utils.HardroidUtils;
import com.hardroid.workload.utils.Singleton;

public class ObsvDescFragment extends Fragment{

	private DigitalClock clock;
	private  TextView tallyText;
	private  TextView gapText;
	private  TextView dateText;
	
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
	}
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		return inflater.inflate(R.layout.fragment_obsv_desc	, container, false);
	}
	
	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onActivityCreated(savedInstanceState);
		clock = (DigitalClock) getView().findViewById(R.id.obsv_desc_clock);
		dateText = (TextView) getView().findViewById(R.id.obsv_desc_date);
		tallyText = (TextView) getView().findViewById(R.id.obsv_desc_tally);
		gapText = (TextView) getView().findViewById(R.id.obsv_desc_gap);			
		
		dateText.setText(HardroidUtils.dateToSDate(new Date()) + " , ");
		tallyText.setText(Singleton.currentProject.obsvDesc.nTally+"");
		gapText.setText(Singleton.currentProject.obsvDesc.obsvGap+" minutes");
	
		
	}
}
